{template 'common/header'}
<ul class="nav nav-tabs">
        <li {if $op == 'list'}class="active" {/if}>
            <a href="{php echo $this->createWebUrl('property', array('op' => 'list'));}">物业管理</a>
        </li>
        {if !$user}
        <li>
            <a href="{php echo $this->createWebUrl('property', array('op' => 'add'));}">新增物业</a>
        </li>
        {/if}
        
    </ul>
    <div class="panel panel-info">
        <div class="panel-heading">筛选</div>
        <div class="panel-body">
            <form action="" method="post" class="form-horizontal" role="form">
                <div class="form-group">
                    <label class="col-xs-12 col-sm-2 col-md-2 control-label">物业名称</label>
                    <div class="col-sm-8 col-md-8 col-lg-8 col-xs-12">
                        <input class="form-control" name="keyword" id="" type="text" value="{$_GPC['keyword']}">
                    </div>
                </div>
                <div class="form-group">
                    <div class="pull-right col-xs-12 col-sm-2 col-md-2 col-lg-2">
                        <button class="btn btn-default"><i class="fa fa-search"></i> 搜索</button>
                    </div>
                </div>
            </form>
        </div>
    </div>
    <div style="padding:15px;" >
        <table class="table table-hover">
            <thead class="navbar-inner">
                <tr>
                    <th style="width:5%;">id</th>
                    <th style="width:10%;">物业名称</th>
                    <th style="width:15%;">物业电话</th>
                    <th style="width:15%;">操作</th>
                </tr>
            </thead>
            <tbody>
                {loop $list $item}
                <tr>
                    <td>{$item['id']}</td>
                    <td>{$item['title']}</td>
                    <td>
                        {$item['telphone']}
                    </td>
                    <td>
                        <a href="{php echo $this->createWebUrl('property',array('op' => 'add','id' => $item['id']))}" title="编辑" class="btn btn-default btn-sm" ><i class="fa fa-edit" ></i>编辑</a> 
                        {if !$user}
                        <a  href="JavaScript:;" data="{$item['id']}" class="btn btn-default btn-sm" data-original-title="删除"><i class="fa fa-times"></i>删除</a>
                        {/if}
                        <a href="{php echo $this->createWebUrl('property', array('op' => 'payment','pid' => $item['id']))}"  class="btn btn-default btn-sm">支付设置</a>
                        <a href="{php echo $this->createWebUrl('region',array('op' => 'list','pid' => $item['id']))}"  class="btn btn-default btn-sm" ><i class="glyphicon glyphicon-search" data-toggle="tooltip" data-placement="top"></i>管理小区</a> 
                    </td>
                </tr>
                {/loop}
            </tbody>
        </table>
        {$pager}
    </div>
<script type="text/javascript">
 $(function () {
        $(".btn").bind("click",function(){
            var id = $(this).attr('data');
            var url = "{php echo $this->createWebUrl('property',array('op' => 'delete'))}";
                $.post(url,
                {
                    id:id
                },
                function(msg){
                        if (msg.status == 1) {
                            setTimeout(function(){
                                window.location.reload();
                             },100);
                        };
                        
                },
                'json');
        });
});
</script>


{template 'common/footer'}